import java.util.*;


class Solution1 {

    public static String setstring (String str) {
       StringBuffer str1 = new StringBuffer();
       str1.append(str.charAt(0));
        for (int i = 1; i < str.length(); i++) {
            int r = 0;
            for (int j = 0; j < i; j++) {
                if(str.charAt(i) == str.charAt(j)) {
                    r = 1;
                    break;
                }
            }
            if(r == 0) {
                str1.append(str.charAt(i));
            }
        }
        return str1.toString();
    }
}
public class Test {
    public static void main(String[] args) {
        System.out.println(Solution1.setstring("BAabB"));
    }
}
